package com.cj.elasticsearch.controller;

import com.cj.common.config.handerconfig.IgnoreToken;
import com.cj.common.response.Result;
import com.cj.elasticsearch.service.ElasticsearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author cheng jun
 * @Description:
 * @Date 2021/11/6 19:06
 */
@RestController
@RequestMapping(value = "/elasticsearch")
public class ElasticsearchController {

    @Autowired
    private ElasticsearchService elasticsearchService;

    @RequestMapping(value = "/indexData", method = {RequestMethod.GET, RequestMethod.POST})
    @IgnoreToken
    public Result indexData() {
        return Result.success(elasticsearchService.indexData());
    }
}
